package com.deercrowing.takeaway.entity;

import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;

/**
 * 购物车(ShoppingCart)表实体类
 *
 * @author guoyongxiang
 * @since 2024-07-22 14:11:42
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tb_shopping_cart")
public class ShoppingCartEntity extends Model<ShoppingCartEntity> {
    //ID，唯一标识    
    @TableId
    private Long id;
    //商品名称    
    @TableField("name")
    private String name;
    //图片    
    @TableField("image")
    private String image;
    //主键    
    @TableField("user_id")
    private Long userId;
    //菜品id    
    @TableField("dish_id")
    private Integer dishId;
    //套餐id    
    @TableField("setmeal_id")
    private Integer setmealId;
    //口味    
    @TableField("dish_flavor")
    private String dishFlavor;
    //数量    
    @TableField("number")
    private Short number;
    //金额    
    @TableField("amount")
    private Double amount;
    //创建时间    
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
    
}

